import { getSelectDataMapList, getTenantID, renderTableText, tableSorter, tooltipLength } from '@/utils';
import { Input, InputNumber, Tooltip, TreeSelect, message } from 'antd';
import pageStyles from '@/common/pageLayout.less';
import { ColumnsRenderFun, DictionaryRenderFun, formatDecimalFour } from '../../../Acommon';
import { ILoadMapTypeAll } from '@/common';
import { CopyOutlined } from '@ant-design/icons';
// 资产模态框Table表格的配置
const getUseAssetModalColumns = ({
  batchSyncData,
  changeLocation,
  changeLocationInfo,
  changeNum,
  setisNextBtnFun,
  queryType = '1',
  editState,
  mapLoading,
  loadMapInfo,
  midiList,
}) => {
  const assetAreaList = getSelectDataMapList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_AREA}`], 'name', 'id', true);

  let columnArr: any = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      ishidden: queryType == '1' ? true : false,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record: Record<string, any>) => {
        return (
          <Tooltip title={tooltipLength(text, 50)}>
            <span>{text || '--'}</span>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 160,
      ellipsis: {
        showTitle: true,
      },
      fixed: 'left',
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetName > b.assetName ? 1 : -1),
      render: (text: string, record: Record<string, any>) => ColumnsRenderFun({ text, isTooltip: true }),
    },
    {
      title: '资产分类',
      dataIndex: 'assetClassName',
      key: 'assetClassName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetClassName > b.assetClassName ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '品牌',
      dataIndex: 'brandType',
      key: 'brandType',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.brandType > b.brandType ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '规格型号',
      dataIndex: 'paramsInfo',
      key: 'paramsInfo',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.paramsInfo > b.paramsInfo ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '状态',
      dataIndex: 'assetStateName',
      key: 'assetStateName',
      width: 110,
      visible: true,
      sorter: (a: any, b: any) => tableSorter(a, b, 'assetStateName'),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '供应商',
      dataIndex: 'supplier',
      key: 'supplier',
      width: 150,
      // ishidden: (queryType == '2' ? true : false),
      visible: true,
      sorter: (a: any, b: any) => tableSorter(a, b, 'supplier'),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '数量',
      dataIndex: 'residueNum',
      key: 'residueNum',
      ishidden: true,
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.residueNum > b.residueNum ? 1 : -1),
      render: (text: string, record) => {
        if (queryType == '2') {
          return (
            <Tooltip title={text}>
              <div className={pageStyles['over-flow-hidden']}>{record?.quantityOrArea || '--'}</div>
            </Tooltip>
          );
        } else {
          if (editState) {
            return (
              <Tooltip title={record?.quantityOrArea || '--'}>
                <div className={pageStyles['over-flow-hidden']}>{record?.quantityOrArea || '--'}</div>
              </Tooltip>
            );
          } else {
            return (
              <Tooltip title={record?.quantityOrArea}>
                <div className={pageStyles['over-flow-hidden']}>{record?.quantityOrArea || '--'}</div>
              </Tooltip>
            );
          }
        }
      },
    },
    {
      title: '计量单位',
      dataIndex: 'unitOfMeasurementName',
      key: 'unitOfMeasurementName',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.unitOfMeasurement > b.unitOfMeasurement ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '资产原值（元）',
      dataIndex: 'totalValue',
      key: 'totalValue',
      width: 170,
      visible: true,
      sorter: (a: any, b: any) => (a.totalValue > b.totalValue ? 1 : -1),
      render: (text: string | number) => formatDecimalFour(text),
    },
  ];

  if (queryType != '2' && !editState) {
    const title = () => {
      return (
        <>
          <span style={{ color: '#f00', fontSize: '18px' }}></span> 存放区域
        </>
      );
    };
    columnArr.push(
      {
        title: title(),
        dataIndex: 'location',
        key: 'location',
        width: 180,
        visible: false,
        fixed: 'right',
        render: (text: string, record: Record<string, any>) => {
          return (
            <TreeSelect
              suffixIcon={
                <>
                  <Tooltip title="批量同步存放区域数据">
                    <a>
                      <CopyOutlined onClick={() => batchSyncData('location', record)} />
                    </a>
                  </Tooltip>
                </>
              }
              status={record?.selected && !text ? 'error' : ''}
              bordered={record?.selected && !text ? true : false}
              loading={mapLoading}
              placeholder="请选择"
              treeData={assetAreaList}
              fieldNames={{
                label: 'name',
                value: 'id',
                children: 'children',
              }}
              value={text}
              style={{ width: '100%' }}
              showSearch={true}
              treeNodeFilterProp={'name'}
              allowClear={false}
              onChange={(value: string) => {
                changeLocation(record.id, value);
              }}
            />
          );
        },
      },
      {
        title: '详细地点',
        dataIndex: 'locationInfo',
        key: 'locationInfo',
        width: 180,
        visible: false,
        fixed: 'right',
        render: (text: string, record: Record<string, any>) => {
          return (
            <Input.Group compact>
              <Tooltip title="批量同步详细地点数据">
                <a onClick={() => batchSyncData('locationInfo', record)}>
                  <CopyOutlined style={{ position: 'absolute', right: 15, bottom: 8, zIndex: 2 }} />
                </a>
              </Tooltip>
              <Input.TextArea
                value={text}
                status={record?.selected && !text ? 'error' : ''}
                bordered={record?.selected && !text ? true : false}
                rows={1}
                cols={1}
                placeholder="请输入"
                onChange={(e) => {
                  changeLocationInfo(record.id, e.target.value);
                }}
                style={{ width: '100%' }}
              />
            </Input.Group>
          );
        },
      },
    );
  }

  return columnArr;
};

const getReturnAssetModalColumns = ({
  batchSyncData,
  changeLocation,
  changeLocationInfo,
  changeNum,
  setisNextBtnFun,
  queryType = '2',
  editState,
  mapLoading,
  loadMapInfo,
  midiList,
}) => {
  const assetAreaList = getSelectDataMapList(loadMapInfo?.[`${getTenantID()}${ILoadMapTypeAll.ASSET_AREA}`], 'name', 'id', true);

  let columnArr: any = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      // ishidden: queryType == '1' ? true : false,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record: Record<string, any>) => ColumnsRenderFun({ text, isTooltip: true }),
    },
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 160,
      ellipsis: {
        showTitle: true,
      },
      fixed: 'left',
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetName > b.assetName ? 1 : -1),
      render: (text: string, record: Record<string, any>) => ColumnsRenderFun({ text, isTooltip: true }),
    },
    {
      title: '资产分类',
      dataIndex: 'assetClassName',
      key: 'assetClassName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetClassName > b.assetClassName ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '品牌',
      dataIndex: 'brandType',
      key: 'brandType',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.brandType > b.brandType ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '规格型号',
      dataIndex: 'paramsInfo',
      key: 'paramsInfo',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.paramsInfo > b.paramsInfo ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false, isTooltip: true }),
    },
    {
      title: '状态',
      dataIndex: 'assetStateName',
      key: 'assetStateName',
      width: 110,
      visible: true,
      sorter: (a: any, b: any) => tableSorter(a, b, 'assetStateName'),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '供应商',
      dataIndex: 'supplier',
      key: 'supplier',
      width: 150,
      // ishidden: (queryType == '2' ? true : false),
      visible: true,
      sorter: (a: any, b: any) => tableSorter(a, b, 'supplier'),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '数量',
      dataIndex: 'residueNum',
      key: 'residueNum',
      ishidden: true,
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.residueNum > b.residueNum ? 1 : -1),
      render: (text: string, record) => {
        if (queryType == '2') {
          return (
            <Tooltip title={text}>
              <div className={pageStyles['over-flow-hidden']}>{record?.quantityOrArea || '--'}</div>
            </Tooltip>
          );
        } else {
          if (editState) {
            return (
              <Tooltip title={record?.quantityOrArea || '--'}>
                <div className={pageStyles['over-flow-hidden']}>{record?.quantityOrArea || '--'}</div>
              </Tooltip>
            );
          } else {
            return (
              <Tooltip title={text}>
                <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
              </Tooltip>
            );
          }
        }
      },
    },
    {
      title: '计量单位',
      dataIndex: 'unitOfMeasurementName',
      key: 'unitOfMeasurementName',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.unitOfMeasurement > b.unitOfMeasurement ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '资产原值（元）',
      dataIndex: 'totalValue',
      key: 'totalValue',
      width: 170,
      visible: true,
      sorter: (a: any, b: any) => (a.totalValue > b.totalValue ? 1 : -1),
      render: (text: string | number) => formatDecimalFour(text),
    },
    // {
    //   title: '管理部门',
    //   dataIndex: 'assetDepartmentName',
    //   key: 'assetDepartmentName',
    //   width: 120,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.assetDepartmentName > b.assetDepartmentName ? 1 : -1),
    //   render: (text: string) => {
    //     return (
    //       <Tooltip title={text}>
    //         <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
    //       </Tooltip>
    //     );
    //   },
    // },
    // {
    //   title: '管理人',
    //   dataIndex: 'asseterName',
    //   key: 'asseterName',
    //   width: 120,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.asseterName > b.asseterName ? 1 : -1),
    //   render: (text: string) => {
    //     return (
    //       <Tooltip title={text}>
    //         <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
    //       </Tooltip>
    //     );
    //   },
    // },
    // {
    //   title: '使用部门',
    //   dataIndex: 'useDepartmentName',
    //   key: 'useDepartmentName',
    //   width: 120,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.useDepartmentName > b.useDepartmentName ? 1 : -1),
    //   render: (text: string) => {
    //     return (
    //       <Tooltip title={text}>
    //         <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
    //       </Tooltip>
    //     );
    //   },
    // },
    {
      title: '使用人',
      dataIndex: 'userName',
      key: 'userName',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.userName > b.userName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    // {
    //   title: '取得方式',
    //   dataIndex: 'obtainTypeName',
    //   key: 'obtainTypeName',
    //   width: 120,
    //   ellipsis: {
    //     showTitle: true,
    //   },
    //   visible: true,
    //   unDrag: true,
    //   sorter: (a: any, b: any) => (a.obtainTypeName > b.obtainTypeName ? 1 : -1),
    //   render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    // },
    // {
    //   title: '取得时间',
    //   dataIndex: 'obtainDate',
    //   key: 'obtainDate',
    //   width: 150,
    //   visible: false,
    //   sorter: (a: any, b: any) => (a.enterStoreTime > b.enterStoreTime ? 1 : -1),
    //   render: (text: string) => {
    //     return text ? moment(text).format('YYYY-MM-DD') : '--';
    //   },
    // },
    // {
    //   title: '合同编号',
    //   dataIndex: 'contractCode',
    //   key: 'contractCode',
    //   width: 120,
    //   ellipsis: {
    //     showTitle: true,
    //   },
    //   visible: true,
    //   unDrag: true,
    //   sorter: (a: any, b: any) => (a.contractCode > b.contractCode ? 1 : -1),
    //   render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    // },
    // {
    //   title: '财务入账状态',
    //   dataIndex: 'entryStateName',
    //   key: 'entryStateName',
    //   width: 150,
    //   ellipsis: {
    //     showTitle: true,
    //   },
    //   visible: true,
    //   unDrag: true,
    //   sorter: (a: any, b: any) => (a.entryStateName > b.entryStateName ? 1 : -1),
    //   render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    // },
  ];

  if (queryType != '2' && !editState) {
    const title = () => {
      return (
        <>
          <span style={{ color: '#f00', fontSize: '18px' }}></span> 存放区域
        </>
      );
    };
    columnArr.push(
      {
        title: title(),
        dataIndex: 'location',
        key: 'location',
        width: 150,
        visible: false,
        fixed: 'right',
        render: (text: string, record: Record<string, any>) => {
          return (
            <TreeSelect
              suffixIcon={
                <>
                  <Tooltip title="批量同步存放区域数据">
                    <a>
                      <CopyOutlined onClick={() => batchSyncData('location', record)} />
                    </a>
                  </Tooltip>
                </>
              }
              status={record?.selected && !text ? 'error' : ''}
              bordered={record?.selected && !text ? true : false}
              loading={mapLoading}
              placeholder="请选择"
              treeData={assetAreaList}
              fieldNames={{
                label: 'name',
                value: 'id',
                children: 'children',
              }}
              value={text}
              style={{ width: '100%' }}
              showSearch={true}
              treeNodeFilterProp={'name'}
              allowClear={false}
              onChange={(value: string) => {
                changeLocation(record.id, value);
              }}
            />
          );
        },
      },
      {
        title: '详细地点',
        dataIndex: 'locationInfo',
        key: 'locationInfo',
        width: 180,
        visible: false,
        fixed: 'right',
        render: (text: string, record: Record<string, any>) => {
          return (
            <Input.Group compact>
              <Tooltip title="批量同步详细地点数据">
                <a onClick={() => batchSyncData('locationInfo', record)}>
                  <CopyOutlined style={{ position: 'absolute', right: 15, bottom: 8, zIndex: 2 }} />
                </a>
              </Tooltip>
              <Input.TextArea
                value={text}
                status={record?.selected && !text ? 'error' : ''}
                bordered={record?.selected && !text ? true : false}
                rows={1}
                cols={1}
                placeholder="请输入"
                onChange={(e) => {
                  changeLocationInfo(record.id, e.target.value);
                }}
                style={{ width: '100%' }}
              />
            </Input.Group>
          );
        },
      },
      // {
      //   title: '领用数量',
      //   dataIndex: 'quantityOrArea',
      //   key: 'quantityOrArea',
      //   width: 120,
      //   fixed: 'right',
      //   render: (text: number | string, record: Record<string, any>) => {
      //     let MaxNum: number = 0;
      //     if (editState) {
      //       MaxNum = Number(record?.quantityOrArea || 0);
      //     } else {
      //       MaxNum = Number(record?.residueNum || 0);
      //     }
      //     // 控制当数量大于当前可选数量时显示
      //     let ishowMax = Number(text) > MaxNum ? true : false;
      //     let ishowMin = Number(text) <= 0;

      //     if (MaxNum <= 0) {
      //       return <div style={{ textAlign: 'center', padding: '0 11px' }}>暂无资产数量</div>;
      //     } else {
      //       return (
      //         <>
      //           <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
      //             <InputNumber
      //               status={ishowMax || ishowMin ? 'error' : ''}
      //               bordered={ishowMax || ishowMin ? true : false}
      //               value={text}
      //               style={{ width: '100%' }}
      //               onChange={(value: any) => {
      //                 if (Number(value) > MaxNum || Number(value) <= 0) {
      //                   setisNextBtnFun(false);
      //                 } else {
      //                   setisNextBtnFun(true);
      //                 }

      //                 if (Number(value) > Number(record.residueNum)) {
      //                   message.error('材料数量不足！');
      //                   return;
      //                 } else {
      //                   changeNum(record.id, value);
      //                 }
      //               }}
      //               min={1}
      //               max={MaxNum}
      //               disabled={
      //                 text === 0 ||
      //                 (midiList
      //                   ? midiList.find((item: any) => {
      //                       return item.id === record.unitOfMeasurement;
      //                     }).remark === 'N'
      //                   : true)
      //               }
      //               precision={2}
      //             />
      //           </div>
      //           {ishowMax && <div style={{ paddingLeft: '5px', color: 'red' }}>{`最多可选择的数量为${MaxNum}`}</div>}
      //           {ishowMin && <div style={{ paddingLeft: '5px', color: 'red' }}>{`最少选择的数量为1`}</div>}
      //         </>
      //       );
      //     }
      //   },
      // },
    );
  }

  return columnArr;
};

/** 材料模态框Table表格的配置 */
const getMaterialModalColumns = ({ changeNum, setisNextBtnFun, queryType }) => {
  let columnArr: any = [
    {
      title: '材料编号',
      dataIndex: 'materialCode',
      key: 'materialCode',
      width: 120,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.materialCode > b.materialCode ? 1 : -1),
      render: (text: string, record: Record<string, any>) => {
        return (
          <Tooltip title={tooltipLength(text, 50)}>
            <span>{text || '--'}</span>
          </Tooltip>
        );
      },
    },
    {
      title: '材料名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 120,
      sorter: (a: any, b: any) => tableSorter(a, b, 'assetName'),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },

    {
      title: '材料分类',
      dataIndex: 'assetClassName',
      key: 'assetClassName',
      width: 110,
      sorter: (a: any, b: any) => tableSorter(a, b, 'assetClassName'),
      render: (text: number) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '品牌',
      dataIndex: 'brandType',
      key: 'brandType',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.brandType > b.brandType ? 1 : -1),
      render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '规格型号',
      dataIndex: 'paramsInfo',
      key: 'paramsInfo',
      width: 110,
      sorter: (a: any, b: any) => tableSorter(a, b, 'paramsInfo'),
      render: (text: string, record: any) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '供应商',
      dataIndex: 'supplier',
      key: 'supplier',
      width: 150,
      // ishidden: (queryType == '2' ? true : false),
      visible: true,
      // sorter: (a: any, b: any) => tableSorter(a?.assetjson, b?.assetjson, 'supplier'),
      // render: (text: string, record) => renderTableText(record?.assetjson?.supplier, true),
      sorter: (a: any, b: any) => tableSorter(a, b, 'supplier'),
      render: (text: string, record) => renderTableText(text, true),
    },
    {
      title: '数量',
      dataIndex: 'residueNum',
      key: 'residueNum',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.residueNum > b.residueNum ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '计量单位',
      dataIndex: 'unitOfMeasurementName',
      key: 'unitOfMeasurementName',
      width: 140,
      sorter: (a: any, b: any) => tableSorter(a, b, 'unitOfMeasurement'),
      render: (text: string) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '单价(元)',
      dataIndex: 'assetValue',
      key: 'assetValue',
      width: 100,
      sorter: (a: any, b: any) => tableSorter(a, b, 'assetValue'),
      render: (text: string | number) => formatDecimalFour(text),
    },
  ];

  if (queryType == '1' || queryType == '3') {
    let str = queryType == '1' ? '领用' : '借用';
    columnArr.push({
      title: str + '数量',
      dataIndex: 'quantityOrArea',
      key: 'quantityOrArea',
      width: 160,
      fixed: 'right',
      sorter: (a: any, b: any) => tableSorter(a, b, 'quantityOrArea'),
      render: (text: number | string, record: Record<string, any>) => {
        const MaxNum: number = Number(record?.residueNum || 0);
        // 控制当数量大于当前可选数量时显示
        let ishowMax = Number(text) > MaxNum ? true : false;
        let ishowMin = Number(text) <= 0;
        if (MaxNum <= 0) {
          return <div style={{ textAlign: 'center', padding: '0 11px' }}>暂无材料数量</div>;
        } else {
          return (
            <>
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                <InputNumber
                  status={ishowMax || ishowMin ? 'error' : ''}
                  bordered={ishowMax || ishowMin ? true : false}
                  value={text}
                  style={{ width: '100%' }}
                  onChange={(value: any) => {
                    if (Number(value) > MaxNum || Number(value) <= 0) {
                      setisNextBtnFun(true);
                    } else {
                      setisNextBtnFun(false);
                    }

                    if (Number(value) > Number(record.residueNum)) {
                      message.error('材料数量不足！');
                      return;
                    } else {
                      changeNum(record.id, value);
                    }
                  }}
                  min={1}
                  max={MaxNum}
                  disabled={text == 0}
                  precision={2}
                />
              </div>
              {ishowMax && <div style={{ paddingLeft: '5px', color: 'red' }}>{`最多可选择的数量为${MaxNum}`}</div>}
              {ishowMin && <div style={{ paddingLeft: '5px', color: 'red' }}>{`最少选择的数量为1`}</div>}
            </>
          );
        }
      },
    });
  }
  return columnArr;
};

export { getReturnAssetModalColumns, getUseAssetModalColumns, getMaterialModalColumns };
